﻿using MediatR;
using RBAC.LuFang.API.Application.Command.MenuCommand;
using RBAC.LuFang.Domain;
using RBAC.LuFang.Domain.DTO;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.MenuHandler
{
    //显示菜单
    public class MenuSelectCommandHandler:IRequestHandler<MenuSelectCommand, Pagese>
    {
        private readonly IMenuService _menuService;

        public MenuSelectCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }

        public async Task<Pagese> Handle(MenuSelectCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetMenu(request.pageindex,request.pagesize,request.mname);
        }
    }
}
